Slides for the RStudio Tips and Tricks Series are available
https://jeremy-allen.github.io/rstudio-tps/
library(palmerpenguins)
library(tidyverse)
library(janitor)
library(here)
viewer pane
Visual Editor
😄 Pro tip: cmd+, to access global options
😄 Pro tip: If you are on a Linux server, see what operating system you are on by running this in your console:
system("lsb_release -a")
Then go to RStudio Public Package Manager
😄 shift+cmd+p then do anything
Use shift+cmd+p to access the command palette and:
😄 Pro tip: Navigate your document with the outline
😄 also ctl+shift+o
Go back up to the line “set repo for RStudio Public Package Manager”
😄 Click the little triangle next to the line number
😄 Pro tip: in the console type a couple of letters then cmd+up for visual of matches
😄 Pro tip: open file in new column is great for Shiny apps when you have ui, sever, and css files
😄 Pro tip: alt+up or alt+down to move lines
😄 Pro tip: ctl+alt+down or ctl+alt+up to have multi-line cursor
You try: add commas after starts_with() and mean
df %>%
summarise(
across(
starts_with("culmen")
mean
na.rm = TRUE
)
)
😄 Pro tip: double click one of the parentheses to highlight what it contains
div(
class = "outer",
div(
class = "container",
div(
class = "data",
df %>%
filter(
str_detect(Species, "Chin"),
Sex == "MALE",
Island == "Dream"
) %>%
summarise(
across(
starts_with("culmen"),
mean,
na.rm = TRUE
)
)
)
)
)
😄 Pro tip: execute code or scripts as jobs in separate R sessions so you can keep working in your IDE
Jobs
😄 Pro tip: ctl+alt+m to open the commit window
😄 Pro tip: can stage or discard chunks, even lines
😄 Pro tip: select first file then cmd+a to highlight all, then check one to check all
Git discard
Comment and not
😄 Pro tip: highlight multiple lines of code, shift+ctl+c to comment all